#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
#include <stdio.h>

int main()
{
    char ch;
    while (scanf("%c", &ch) != EOF)
    {
        if (ch >= 'A' && ch <= 'Z')
            ch += 32;
        else if (ch >= 'a' && ch <= 'z')
            ch -= 32;
        printf("%c", ch);
    }
    return 0;
}